package cn.iocoder.yudao.module.common.dal.mysql.tagrelation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.tagrelation.TagRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.common.controller.admin.tagrelation.vo.*;

/**
 * 标签关系 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TagRelationMapper extends BaseMapperX<TagRelationDO> {

    default PageResult<TagRelationDO> selectPage(TagRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TagRelationDO>()
                .eqIfPresent(TagRelationDO::getEntityId, reqVO.getEntityId())
                .eqIfPresent(TagRelationDO::getEntityType, reqVO.getEntityType())
                .eqIfPresent(TagRelationDO::getTagId, reqVO.getTagId())
                .likeIfPresent(TagRelationDO::getCreatorName, reqVO.getCreatorName())
                .betweenIfPresent(TagRelationDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(TagRelationDO::getUpdaterName, reqVO.getUpdaterName())
                .eqIfPresent(TagRelationDO::getVersion, reqVO.getVersion())
                .orderByDesc(TagRelationDO::getId));
    }

}